/*
 *  Copyright 2007 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.webapp.util.core;

import java.util.List;

/**
 * <p>Bean that is used to save info when object to which links exist is being
 * updated/deleted and linked objects page is shown.
 * </p>
 * <p><a href="LinkedObjectsInfoContainer.java.html"><i>View source</i></a></p>
 *
 * @author Roman Puchkovskiy <a href="mailto:roman.puchkovskiy@blandware.com">
 *         &lt;roman.puchkovskiy@blandware.com&gt;</a>
 * @version : $Revision: 1.2 $ : 18.12.2007 12:25:29 $
 */
public class LinkedObjectsInfoContainer {

    // object types

    /**
     * Type saying that object is page
     */
    public static final String TYPE_PAGE = "page";
    /**
     * Type saying that object is content resource
     */
    public static final String TYPE_RESOURCE = "resource";

    /**
     * ID of object being deleted or updated
     */
    protected Long objectId = null;
    /**
     * List of IDs of used objects being deleted or updated. This is list of
     * Long objects. It's used instead of <b>objectId</b> property when folder
     * is moved or deleted.
     */
    protected List objectsIds = null;
    /**
     * Type of object being deleted or updated
     */
    protected String objectType = null;
    /**
     * URL to redirect to after linked objects page is left
     */
    protected String redirectUrl = null;
    /**
     * Action path to delete object
     */
    protected String deleteAction = null;
    /**
     * Action path to update object
     */
    protected String updateAction = null;
    /**
     * New object URI (when updating object)
     */
    protected String newUri = null;
    /**
     * Content locale selected for object
     */
    protected String contentLocaleId = null;
    /**
     * Charset selected for object
     */
    protected String charset = null;
    /**
     * Width
     */
    protected String width = null;
    /**
     * Height
     */
    protected String height = null;
    /**
     * Object publication date
     */
    protected String publicationDate = null;
    /**
     * Object expiration date
     */
    protected String expirationDate = null;
    /**
     * Path (for folder operations)
     */
    protected String path = null;
    /**
     * New path (for folder operations)
     */
    protected String newPath = null;


    /**
     * Sets fields which are needed only for deletion or updating to null.
     */
    public void clearDeleteUpdateFields() {
        setObjectsIds(null);
        setNewUri(null);
        setContentLocaleId(null);
        setCharset(null);
        setWidth(null);
        setHeight(null);
        setPublicationDate(null);
        setExpirationDate(null);
        setUpdateAction(null);
        setDeleteAction(null);
        setPath(null);
        setNewPath(null);
    }

    /**
     * Returns object ID.
     *
     * @return object ID
     */
    public Long getObjectId() {
        return objectId;
    }

    /**
     * Sets object ID.
     *
     * @param objectId  ID to set
     */
    public void setObjectId(Long objectId) {
        this.objectId = objectId;
    }

    /**
     * Returns used objects IDs.
     *
     * @return objects IDs
     * @see #objectsIds
     */
    public List getObjectsIds() {
        return objectsIds;
    }

    /**
     * Sets used objects IDs.
     *
     * @param objectsIds IDs to set
     * @see #objectsIds
     */
    public void setObjectsIds(List objectsIds) {
        this.objectsIds = objectsIds;
    }

    /**
     * Returns object type.
     *
     * @return object type
     */
    public String getObjectType() {
        return objectType;
    }

    /**
     * Sets object type.
     *
     * @param objectType    type to set
     */
    public void setObjectType(String objectType) {
        this.objectType = objectType;
    }

    /**
     * Returns redirect URL.
     *
     * @return redirect URL
     */
    public String getRedirectUrl() {
        return redirectUrl;
    }

    /**
     * Sets redirect URL.
     *
     * @param redirectUrl   URL
     */
    public void setRedirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
    }

    /**
     * Return delete action path.
     *
     * @return delete action
     */
    public String getDeleteAction() {
        return deleteAction;
    }

    /**
     * Sets delete action path.
     *
     * @param deleteAction  action
     */
    public void setDeleteAction(String deleteAction) {
        this.deleteAction = deleteAction;
    }

    /**
     * Returns update action path.
     *
     * @return update action
     */
    public String getUpdateAction() {
        return updateAction;
    }

    /**
     * Sets update action path.
     *
     * @param updateAction  action
     */
    public void setUpdateAction(String updateAction) {
        this.updateAction = updateAction;
    }

    /**
     * Returns new URI.
     *
     * @return new URI
     */
    public String getNewUri() {
        return newUri;
    }

    /**
     * Sets new URI.
     *
     * @param newUri    URI
     */
    public void setNewUri(String newUri) {
        this.newUri = newUri;
    }

    /**
     * Returns content locale ID.
     *
     * @return content locale ID
     */
    public String getContentLocaleId() {
        return contentLocaleId;
    }

    /**
     * Sets content locale ID.
     *
     * @param contentLocaleId   ID to set
     */
    public void setContentLocaleId(String contentLocaleId) {
        this.contentLocaleId = contentLocaleId;
    }

    /**
     * Returns charset.
     *
     * @return charset
     */
    public String getCharset() {
        return charset;
    }

    /**
     * Sets charset.
     *
     * @param charset   charset
     */
    public void setCharset(String charset) {
        this.charset = charset;
    }

    /**
     * Returns width.
     *
     * @return width
     */
    public String getWidth() {
        return width;
    }

    /**
     * Sets width.
     *
     * @param width     width to set
     */
    public void setWidth(String width) {
        this.width = width;
    }

    /**
     * Returns height.
     *
     * @return height
     */
    public String getHeight() {
        return height;
    }

    /**
     * Sets height.
     *
     * @param height    height to set
     */
    public void setHeight(String height) {
        this.height = height;
    }

    /**
     * Returns publication date.
     *
     * @return publication date
     */
    public String getPublicationDate() {
        return publicationDate;
    }

    /**
     * Sets publication date.
     *
     * @param publicationDate   date to set
     */
    public void setPublicationDate(String publicationDate) {
        this.publicationDate = publicationDate;
    }

    /**
     * Returns expiration date.
     *
     * @return expiration date
     */
    public String getExpirationDate() {
        return expirationDate;
    }

    /**
     * Sets expiration date.
     *
     * @param expirationDate    date to set
     */
    public void setExpirationDate(String expirationDate) {
        this.expirationDate = expirationDate;
    }

    /**
     * Returns path.
     *
     * @return path
     */
    public String getPath() {
        return path;
    }

    /**
     * Sets path.
     *
     * @param path path to set
     */
    public void setPath(String path) {
        this.path = path;
    }

    /**
     * Returns new path.
     *
     * @return new path
     */
    public String getNewPath() {
        return newPath;
    }

    /**
     * Sets new path.
     *
     * @param newPath path to set
     */
    public void setNewPath(String newPath) {
        this.newPath = newPath;
    }
}
